package com.zhiqiang.gameserver.constant;

public class R {
    /**
     * 编解码常量
     */
    public static class EncoderAndDecoder{
        public static final int HEADER_LENGTH = 48;
        public static final int MAX_FRAME_LENGTH = 1024*1024;
        public static final int LENGTH_FIELD_LENGTH = 4;
        public static final int LENGTH_FIELD_OFFSET = 0;
        public static final int LENGTH_ADJUSTMENT = -4;
        public static final int INITIAL_BYTES_TO_STRIP = 0;
    }
    public static class LoginType{
        public static final String MD5LOGIN="MD5";
        public static final String WECHAT="WECHAT";
        public static final String ACCOUNT="ACCOUNT";
    }
    /**
     * 消息类型常量
     */
     public static class MessageType{

         //用户登录注册请求返回 用户相关编码从1-200
         public static final int REQUSERLOGIN = 0x00000001;
         public static final int RSPUSERLOGIN = 0x00001001;

         // KeepAlive
        public static final int ReqClientKeepAlive = 0x00000002;
        public static final int RspClientKeepAlive = 0x00001002;

        //任务
        public static final int ReqTask = 0x00000003;
        public static final int RspTask = 0x00001003;

    }
    public static class ERRCode{
        public static final int OK = 200;
        public static final int ERR  = -999999;
         //   // 基本错误  -10xxx
        public static final int ERR_NO_BUILD_SEQ = 16; 	   //没有可用的建造升级队列
        public static final int ERR_RPC_NO_MOD   = -11001; //rpc模块不存在
        public static final int ERR_RPC_NO_METHOD = -11002;   //rpc方法不存在
        public static final int ERR_RPC_TIMEOUT   = -11003;   //rpc超时
        public static final int ERR_RPC_DECODE_PARAM  = -11004;   //非法参数
        public static final int ERR_LOCAL_DECODE_FAIL  = -11005;   //本地调用解包失败

    // 登录模块
        public static final int  ERR_LOGIN_INV_PARAM   = -20001;
        public static final int  ERR_LOGIN_NEED_LOGIN   = -20005;	//需要重新登录
        public static final int  ERR_LOGIN_SERVER_BUSY  = -20006;	//系统繁忙
        public static final int  ERR_LOGIN_SYSTEM_ERR   = -20007;	//系统错误
        public static final int  ERR_LOGIN_CHAR_EXIST   = -20008;   //角色已存在
        public static final int  ERR_LOGIN_DUPLICATED   = -20009;   //重复登录
    }
    /**
     * 加解密钥匙编码
     */
    public static class EncryptKey{
        public static final String key = "_YYQIsGOODGUYHHZJustLikeaSb+*&^%ZQ";
    }

    /**
     * orm
     */
    public static class OrmPara{
        public static final String MYSQL_JDBC_URL="jdbc:mysql://localhost:3306/ZQGameServer";
        public static final String MYSQL_JDBC_USER="root";
        public static final String MYSQL_JDBC_PWD="Root1234$";

        //redis

        public static final String REDIS_IP="127.0.0.1";
        public static final int REDIS_PORT=6379;
        public static final String REDIS_PWD="yyq";

        //redis 常量参数
        public static final String MAXUSERIDSTRING = "MAXUSERID";
        public static final String MAXACCOUNTIDSTRING = "MAXACCOUNTID";
        public static final String USERCACHEPREFIX="ZQGS";

    }
}
